<!DOCTYPE html>
<html>
<#include "../head.html">
<body class="full">
<div class="mc">
    <div>
        <div class="mc-l">
            <!--左侧导航---{-->
            <div id="navPanelContainer">
                <div class="system-logo cd"></div>
                <!--管理员信息---{-->
                    <#include "../adminInfo.html">
                <!--管理员信息---}-->
                <div class="nav-wrap">
                    <#include "left.html">
                </div>
            </div>
            <!--左侧导航---}-->
        </div>
        <div class="mc-m">
            <div class="navToggle"></div>
        </div>
        <div class="mc-r">
            <!--顶部导航---{-->
            <#include "../topNav.html">
            <!--顶部导航---}-->

            <!--面包屑导航---{-->
            <#assign moduleName="红包领取">
            <#include "banner.html">
            <!--面包屑导航---}-->

            <!--工具栏--{-->
            <div id="toolbar" class="clearfix">
                <div class="s_toolTop">
                    <div class="toolbor-module export">
                        <input type="button" onclick="exportxls()" value="导出列表" class="input-button export-btn"/>
                    </div>
                </div>
                <div class="s_toolTop">
                    <div class="toolbor-module export">
                        <div class="formTit">红包类型：</div>
                        <div class="select-box" id="redPacketType">
                            <div class="tag-select">全部</div>
                            <ul class="tag-options">
                                <li data-value="">全  部</li>
                                <li data-value="01">充值</li>
                                <li data-value="02">注册</li>
                                <li data-value="03">认证</li>
                                <li data-value="04">邀请</li>
                                <li data-value="05">首次投标</li>
                                <li data-value="51">拔得头筹</li>
                                <li data-value="52">一锤定音</li>
                                <li data-value="53">一马当先</li>
                                <li data-value="54"><!--幸运之星-->天下无双</li>
                                <li data-value="10">中秋宝箱</li>
                                <li data-value="11">中秋状元</li>
                                <li data-value="12">中秋榜眼</li>
                                <li data-value="13">中秋探花</li>
                                <li data-value="20">十一抢钱</li>
                                <li data-value="30">奖励宝箱</li>
                                <li data-value="31">活动宝箱</li>
                                <li data-value="40">邀请奖励</li>
                                <li data-value="55"><!--幸运女神1-->喜从天降</li>
                                <li data-value="56">幸运女神2</li>
                                <li data-value="32">活动抽奖</li>
                                <li data-value="07">生日</li>
                            </ul>
                        </div>
                    </div>
                    <div class="toolbor-module export" >
                        <div class="formTit">状态：</div>
                        <div class="select-box" id="status">
                            <div class="tag-select">全部</div>
                            <ul class="tag-options">
                                <li data-value="">全  部</li>
                                <li data-value="1">已兑换</li>
                                <li data-value="2">未兑换</li>
                            </ul>
                        </div>
                    </div>
                    <div class="toolbor-module export">
                        <div class="formTit">用户名：</div>
                        <input type="text" name="showName" id="showName" value="请输入用户名"  class="search-value">
                    </div>
                    <div class="toolbor-module export">
                        <div class="formTit">真实姓名：</div>
                        <input type="text" name="realname" id="realname" value="请输入真实姓名"  class="search-value">
                    </div>
                </div>
                <div class="s_toolTop">
                    <div class="toolbor-module export">
                        <div class="formTit">创建时间：</div>
                        <input class="_search-value" name="startDate" id="createStartDate" value="" onclick="change_picktime()"/>
                        <div class="formTit"> 到 </div>
                        <input class="_search-value" name="endDate" id="createEndDate" value=""  onclick="change_picktime()"/>
                    </div>
                    <div class="toolbor-module export">
                        <div class="formTit">到期时间：</div>
                        <input class="_search-value" name="startDate" id="validStartDate" value="" onclick="change_picktime()"/>
                        <div class="formTit"> 到 </div>
                        <input class="_search-value" name="endDate" id="validEndDate" value=""  onclick="change_picktime()"/>
                    </div>
                </div>
                <div class="s_toolTop">
                    <div class="toolbor-module search">
                        <input type="button" value="搜索"  class="input-button" onclick="sousuo();">
                    </div>
                </div>
            </div>
            <!--工具栏--}-->

            <div id="main" class="clearfix">
                <form action="" method="post">
                    <table class="data-list">
                        <tr class="header">
                            <td>ID</td>
                            <td>用户名</td>
                            <td>真实姓名</td>
                            <td>红包额度</td>
                            <td>红包类型</td>
                            <td>使用比例</td>
                            <td>期限限制</td>
                            <td>到期时间</td>
                            <td>创建时间</td>
                            <td>是否兑换</td>
                            <td>兑换时间</td>
                        </tr>
                        <#import "../../common/function.html" as func>
                            <#list list as item>
                                <tr class="s">
                                    <td>${item.id?c}</td>
                                    <td>${item.user.userName!''}</td>
                                    <td>${item.user.realName!''}</td>
                                    <td>${item.redPacketAmount!0}元</td>
                                    <td>
                                    <#if item.redPacketType??&&item.redPacketType=="01">充值
                                    <#elseif item.redPacketType=="02">注册
                                    <#elseif item.redPacketType=="03">认证
                                    <#elseif item.redPacketType=="04">邀请
                                    <#elseif item.redPacketType=="05">首次投标
                                    <#elseif item.redPacketType == "51">拔得头筹
									<#elseif item.redPacketType == "52">一锤定音
									<#elseif item.redPacketType == "53">一马当先
									<#elseif item.redPacketType == "54">天下无双
									<#elseif item.redPacketType == "10">中秋宝箱
									<#elseif item.redPacketType == "11">中秋状元
									<#elseif item.redPacketType == "12">中秋榜眼
									<#elseif item.redPacketType == "13">中秋探花
									<#elseif item.redPacketType == "20">十一抢钱
									<#elseif item.redPacketType == "21">十一抢钱
									<#elseif item.redPacketType == "22">十一抢钱
									<#elseif item.redPacketType == "23">十一抢钱
									<#elseif item.redPacketType == "40">邀请奖励
									<#elseif item.redPacketType == "55">喜从天降
									<#elseif item.redPacketType == "56">幸运女神2
									<#elseif item.redPacketType == "30">奖励宝箱
									<#elseif item.redPacketType == "31">活动宝箱
                                    <#elseif item.redPacketType == "32">活动抽奖
                                    <#elseif item.redPacketType == "07">生日
                                    <#else>其他
                                    </#if>
                                    </td>
                                    <td>${item.aprLimit!''}%</td>
                                    <td>${item.timeLimit!''}天</td>
                                    <td>${item.validDate!''}</td>
                                    <td>${item.createDate!''}</td>
                                    <#if item.exchangeRecord??>
                                    <td style="color:green;">已兑换</td>
                                    <#else>
                                    <td>未兑换</td>
                                    </#if>
                                    <td><span><#if item.exchangeRecord??>${(item.exchangeRecord.exchangeDate)?string("yyyy-MM-dd HH:mm:ss")}<#else>-</#if></span></td>
                                </tr>
                            </#list>
                    </table>
                </form>

                <!--底部工具栏--{-->
                <div id="bottomToolbar" class="clearfix">
                    <div class="other-tool">
                        <dl class="refresh-data">
                            <dt class="refresh-data-icon"></dt>
                            <dd><a href="javascript:void(0);" class="refresh-page">刷新数据</a></dd>
                        </dl>
                    </div>

                    <!--翻页系统--{-->
                    <div class="container s_formPage">
                        <#import "../../common/page.html" as pager>
                            <@pager.pagination page=page url="${pageUrl}" map=param style="style1" />
                    </div>
                    <!--翻页系统--}-->
                </div>
                <!--底部工具栏--}-->

                <script>
                    var urls = 'redPacketRecord.html?search=true';
                    var xlsurl='redPacketRecord.html?type=export';
                    function sousuo(){
                        var sou = "";
                        var showName = $("#showName").val();
                        if (showName!=null&&showName!=""&&showName!="undefine"&&showName!="请输入用户名"){
                            sou += "&showName="+showName;
                        }
                    	 var realname = $("#realname").val();
    					 if(realname!=""&&realname!="请输入真实姓名"){
    						sou += "&realname="+realname;
    					 }
                        var redPacketType = $("#redPacketType").find(".open-selected").attr("data-value");
                        if(redPacketType!=null&&redPacketType!=""&&redPacketType!="undefine"){
                        	sou += "&redPacketType="+redPacketType;
                        } 
                        var status = $("#status").find(".open-selected").attr("data-value");
                        if(status!=null&&status!=""&&status!="undefine"){
                        	sou += "&status="+status;
                        }
                        var createStartDate = $("#createStartDate").val();
                        var createEndDate = $("#createEndDate").val();
                        if (createStartDate!=null){
                           sou += "&createStartDate="+createStartDate;
                        }
                        if (createEndDate!=null){
                           sou += "&createEndDate="+createEndDate;
                        }
                        
                        var validStartDate = $("#validStartDate").val();
                        var validEndDate = $("#validEndDate").val();
                        if (validStartDate!=null){
                           sou += "&validStartDate="+validStartDate;
                        }
                        if (validEndDate!=null){
                           sou += "&validEndDate="+validEndDate;
                        }
                        var url=urls+sou
                        location.href=url;
                    }
                    function exportxls(){
                    					var num='${(page.total)?c}'; 
				num=num.replace(",",""); 
				if(num>30000){ //条数自己定义，但必须小于65536 
					alert("数据过多，请选择指定的时间进行数据查询导出！"); //提示信息根据不同的内容注意修改下。 
					return false; 
				}
                    	 var sou = "";
                         var showName = $("#showName").val();
                         if (showName!=null&&showName!=""&&showName!="undefine"&&showName!="请输入用户名"){
                             sou += "&showName="+showName;
                         }
                     	 var realname = $("#realname").val();
     					 if(realname!=""&&realname!="请输入真实姓名"){
     						sou += "&realname="+realname;
     					 }
                       	 var redPacketType = $("#redPacketType").find(".open-selected").attr("data-value");
                         if(redPacketType!=null&&redPacketType!=""&&redPacketType!="undefine"){
                         	sou += "&redPacketType="+redPacketType;
                         } 
                         var status = $("#status").find(".open-selected").attr("data-value");
                         if(status!=null&&status!=""&&status!="undefine"){
                         	sou += "&status="+status;
                         }
                         var createStartDate = $("#createStartDate").val();
                         var createEndDate = $("#createEndDate").val();
                         if (createStartDate!=null){
                            sou += "&createStartDate="+createStartDate;
                         }
                         if (createEndDate!=null){
                            sou += "&createEndDate="+createEndDate;
                         }
                         
                         var validStartDate = $("#validStartDate").val();
                         var validEndDate = $("#validEndDate").val();
                         if (validStartDate!=null){
                            sou += "&validStartDate="+validStartDate;
                         }
                         if (validEndDate!=null){
                            sou += "&validEndDate="+validEndDate;
                         }
                        if (sou!=""){
                            location.href=xlsurl+sou;
                        }else{
                            location.href=xlsurl;
                        }
                    }
                </script>
            </div>

        </div>
    </div>
    <div>
        <!--尾部--{-->
        <td colspan="3" class="mc-b"><#include "../foot.html"></td>
        <!--尾部--}-->
    </div>
</div>
</body>
</html>
<#include "../jsPage.html">
